package com.shd.edanpei.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.shd.edanpei.bean.UserBean;
import com.shd.edanpei.db.AppInfo;

import com.shd.edanpei.greendao.gen.UserBeanDao;
import com.shd.edanpei.greendao.gen.AppInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userBeanDaoConfig;
    private final DaoConfig appInfoDaoConfig;

    private final UserBeanDao userBeanDao;
    private final AppInfoDao appInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userBeanDaoConfig = daoConfigMap.get(UserBeanDao.class).clone();
        userBeanDaoConfig.initIdentityScope(type);

        appInfoDaoConfig = daoConfigMap.get(AppInfoDao.class).clone();
        appInfoDaoConfig.initIdentityScope(type);

        userBeanDao = new UserBeanDao(userBeanDaoConfig, this);
        appInfoDao = new AppInfoDao(appInfoDaoConfig, this);

        registerDao(UserBean.class, userBeanDao);
        registerDao(AppInfo.class, appInfoDao);
    }
    
    public void clear() {
        userBeanDaoConfig.clearIdentityScope();
        appInfoDaoConfig.clearIdentityScope();
    }

    public UserBeanDao getUserBeanDao() {
        return userBeanDao;
    }

    public AppInfoDao getAppInfoDao() {
        return appInfoDao;
    }

}
